<form action="member_group.manage.php" id="form_add" name="form_add" method="post">
<input type="hidden" name="action" value="set_save" />
<input type="hidden" name="mg_id" id="mg_id" value="<tpl> $group_array.mg_id </tpl>" />
<table border="0" cellpadding="0" cellspacing="0" class="from_table">
	<tr>
		<th><tpl> $langSysMgName </tpl>:</th>
		<td class="td rowform">
			<input type="text" name="mg_name" id="mg_name" value="<tpl> $group_array.mg_name </tpl>" />
		</td>
		<td class="vtop tips2"><label style="display:none" for="mg_name" class="wrong" metaDone="true" generated="true"></label></td>
	</tr>
	<tr>
		<th><tpl> $langSysMgIfLogin </tpl>:</th>
		<td class="td rowform">
			<input type="radio" name="mg_iflogin" id="mg_iflogin_y" value="1" <tpl> if $group_array.mg_iflogin eq '1' </tpl>checked="checked"<tpl> /if </tpl> /><label for="mg_iflogin_y"><tpl> $langSysMgYes </tpl></label>
			<input type="radio" name="mg_iflogin" id="mg_iflogin_n" value="0" <tpl> if $group_array.mg_iflogin eq '0' </tpl>checked="checked"<tpl> /if </tpl> /><label for="mg_iflogin_n"><tpl> $langSysMgNo </tpl></label>
		</td>
		<td class="vtop tips2"><tpl> $langSysMgIfLoginRemark </tpl></td>
	</tr>
	<tr>
		<th><tpl> $langSysMgIfBuy </tpl>:</th>
		<td class="td rowform">
			<input type="radio" name="mg_ifbuy" id="mg_ifbuy_y" value="1" <tpl> if $group_array.mg_ifbuy eq '1' </tpl>checked="checked"<tpl> /if </tpl> /><label for="mg_ifbuy_y"><tpl> $langSysMgYes </tpl></label>
			<input type="radio" name="mg_ifbuy" id="mg_ifbuy_n" value="0" <tpl> if $group_array.mg_ifbuy eq '0' </tpl>checked="checked"<tpl> /if </tpl> /><label for="mg_ifbuy_n"><tpl> $langSysMgNo </tpl></label>
		</td>
		<td class="vtop tips2"><tpl> $langSysMgIfBuyRemark </tpl></td>
	</tr>
	<tr>
		<th><tpl> $langSysMgIfSell </tpl>:</th>
		<td class="td rowform">
			<input type="radio" name="mg_ifsell" id="mg_ifsell_y" value="1" <tpl> if $group_array.mg_ifsell eq '1' </tpl>checked="checked"<tpl> /if </tpl> /><label for="mg_ifsell_y"><tpl> $langSysMgYes </tpl></label>
			<input type="radio" name="mg_ifsell" id="mg_ifsell_n" value="0" <tpl> if $group_array.mg_ifsell eq '0' </tpl>checked="checked"<tpl> /if </tpl> /><label for="mg_ifsell_n"><tpl> $langSysMgNo </tpl></label>
		</td>
		<td class="vtop tips2"><tpl> $langSysMgIfSellRemark </tpl></td>
	</tr>
	<tr>
		<th><tpl> $langSysMgIfOpenShop </tpl>:</th>
		<td class="td rowform">
			<input type="radio" name="mg_ifopen_shop" id="mg_ifopen_shop_y" value="1" <tpl> if $group_array.mg_ifopen_shop eq '1' </tpl>checked="checked"<tpl> /if </tpl> /><label for="mg_ifopen_shop_y"><tpl> $langSysMgYes </tpl></label>
			<input type="radio" name="mg_ifopen_shop" id="mg_ifopen_shop_n" value="0" <tpl> if $group_array.mg_ifopen_shop eq '0' </tpl>checked="checked"<tpl> /if </tpl> /><label for="mg_ifopen_shop_n"><tpl> $langSysMgNo </tpl></label>
		</td>
		<td class="vtop tips2"><tpl> $langSysMgIfOpenShopRemark </tpl></td>
	</tr>
	<tr>
		<th><tpl> $langSysMgIfUseCredit </tpl>:</th>
		<td class="td rowform">
			<input type="radio" name="mg_ifuse_credit" id="mg_ifuse_credit_y" value="1" <tpl> if $group_array.mg_ifuse_credit eq '1' </tpl>checked="checked"<tpl> /if </tpl> /><label for="mg_ifuse_credit_y"><tpl> $langSysMgYes </tpl></label>
			<input type="radio" name="mg_ifuse_credit" id="mg_ifuse_credit_n" value="0" <tpl> if $group_array.mg_ifuse_credit eq '0' </tpl>checked="checked"<tpl> /if </tpl> /><label for="mg_ifuse_credit_n"><tpl> $langSysMgNo </tpl></label>
		</td>
		<td class="vtop tips2"><tpl> $langSysMgIfUseCreditRemark </tpl></td>
	</tr>
	<tr>
		<td>					</td>
	    <td colspan="2">
			<div style="float:left; padding-left:20px">
				<span class="btn_left"><input type="submit" class="btn_submit" name="Submit" value="<tpl> $langSysMgSubmit </tpl>" /></span>
				<span class="btn_left"><input type="button" class="btn_submit" name="return_list" id="return_list" value="<tpl> $langSysMgReturn </tpl>" /></span>			
			</div>
		</td>
    </tr>
</table>
</form>
<script>
$(document).ready(function() {
	$("#return_list").click(function(){
		ShowDiv = "result_content";
		getPageContent("member_group.manage.php?action=ajax_list");
	})
	//添加
	var options = {
		beforeSubmit:  function(){showLoading(showSaveText);},
		success:       function(msg){
							hideLoading();
							showMessage(msg.message,msg.type);
							if(msg.type == '1'){
								ShowDiv	= 'result_content';
								getPageContent("member_group.manage.php?action=ajax_list");
							}
						},
		type:      'post',
		dataType:  'json'
	};
	
	//对添加表单做的验证定义
	$("#form_add").validate({
		errorClass: "wrong",
		rules: {
			mg_name: {required: true}
		},
		messages: {
			mg_name: {required: "<tpl> $errSysMgNameIsEmpty </tpl>"}
		},
		submitHandler: function() {
			$('#form_add').ajaxSubmit(options);
		}
	});
});
</script>